<!DOCTYPE html>
<html>
<head>
	<title>TweenJS: Simple Tween Demo</title>

	<link href="../_assets/css/shared.css" rel="stylesheet" type="text/css"/>
	<link href="../_assets/css/examples.css" rel="stylesheet" type="text/css"/>
	<link href="../_assets/css/tweenjs.css" rel="stylesheet" type="text/css"/>
	<script src="../_assets/js/examples.js" type="text/javascript"></script>

	<script type="text/javascript" src="../_assets/libs/easeljs-NEXT.min.js"></script>
	<script type="text/javascript" src="../lib/tweenjs-NEXT.js"></script>
	<!-- We also provide hosted minified versions of all CreateJS libraries.
		 http://code.createjs.com -->

<script id="editable">
	var canvas, stage, tween;

	function init() {
		canvas = document.getElementById("testCanvas");
		stage = new createjs.Stage(canvas);

		var ball = new createjs.Shape();
		ball.graphics.beginFill("#FF0000").drawCircle(0, 0, 50);
		ball.x = 100;
		ball.y = canvas.height/2;

		tween = createjs.Tween.get(ball, {loop: -1, bounce:true})
			.to({x: canvas.width-100}, 1000)

		stage.addChild(ball);
		
		createjs.Ticker.timingMode = createjs.Ticker.RAF;
		createjs.Ticker.addEventListener("tick", stage);
	}
	
	function setTimeScale(val) {
		tween.timeScale = val;
		timeScaleFld.innerText = val.toFixed(1);
	}

</script>
</head>
<body onload="init();">

<div>
	<header class="EaselJS">
		<h1>TimeScale</h1>

		<p>
			<code>tween.timeScale = <b id="timeScaleFld">1.0</b></code> <input type="range" id="timeScale" min="10" max="200" value="100" oninput="setTimeScale(this.value/100)">
		</p>
	</header>

	<canvas id="testCanvas" width="960" height="400"></canvas>
	
</div>

</body>
</html>
